\(\int x \sqrt {\sec (a+b x)} \sin (a+b x) \, dx\) [340]

   Optimal result
   Rubi [A] (verified)
   Mathematica [C] (verified)
   Maple [C] (verified)
   Fricas [F(-2)]
   Sympy [F]
   Maxima [F]
   Giac [F]
   Mupad [F(-1)]

Optimal result

Integrand size = 18, antiderivative size = 53 \[ \int x \sqrt {\sec (a+b x)} \sin (a+b x) \, dx=-\frac {2 x}{b \sqrt {\sec (a+b x)}}+\frac {4 \sqrt {\cos (a+b x)} E\left (\left .\frac {1}{2} (a+b x)\right |2\right ) \sqrt {\sec (a+b x)}}{b^2} \]

[Out]

-2*x/b/sec(b*x+a)^(1/2)+4*(cos(1/2*a+1/2*b*x)^2)^(1/2)/cos(1/2*a+1/2*b*x)*EllipticE(sin(1/2*a+1/2*b*x),2^(1/2)
)*cos(b*x+a)^(1/2)*sec(b*x+a)^(1/2)/b^2

Rubi [A] (verified)

Time = 0.05 (sec) , antiderivative size = 53, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.167, Rules used = {4297, 3856, 2719} \[ \int x \sqrt {\sec (a+b x)} \sin (a+b x) \, dx=\frac {4 \sqrt {\cos (a+b x)} \sqrt {\sec (a+b x)} E\left (\left .\frac {1}{2} (a+b x)\right |2\right )}{b^2}-\frac {2 x}{b \sqrt {\sec (a+b x)}} \]

[In]

Int[x*Sqrt[Sec[a + b*x]]*Sin[a + b*x],x]

[Out]

(-2*x)/(b*Sqrt[Sec[a + b*x]]) + (4*Sqrt[Cos[a + b*x]]*EllipticE[(a + b*x)/2, 2]*Sqrt[Sec[a + b*x]])/b^2

Rule 2719

Int[Sqrt[sin[(c_.) + (d_.)*(x_)]], x_Symbol] :> Simp[(2/d)*EllipticE[(1/2)*(c - Pi/2 + d*x), 2], x] /; FreeQ[{
c, d}, x]

Rule 3856

Int[(csc[(c_.) + (d_.)*(x_)]*(b_.))^(n_), x_Symbol] :> Dist[(b*Csc[c + d*x])^n*Sin[c + d*x]^n, Int[1/Sin[c + d
*x]^n, x], x] /; FreeQ[{b, c, d}, x] && EqQ[n^2, 1/4]

Rule 4297

Int[(x_)^(m_.)*Sec[(a_.) + (b_.)*(x_)^(n_.)]^(p_)*Sin[(a_.) + (b_.)*(x_)^(n_.)], x_Symbol] :> Simp[x^(m - n +
1)*(Sec[a + b*x^n]^(p - 1)/(b*n*(p - 1))), x] - Dist[(m - n + 1)/(b*n*(p - 1)), Int[x^(m - n)*Sec[a + b*x^n]^(
p - 1), x], x] /; FreeQ[{a, b, p}, x] && IntegerQ[n] && GeQ[m - n, 0] && NeQ[p, 1]

Rubi steps \begin{align*} \text {integral}& = -\frac {2 x}{b \sqrt {\sec (a+b x)}}+\frac {2 \int \frac {1}{\sqrt {\sec (a+b x)}} \, dx}{b} \\ & = -\frac {2 x}{b \sqrt {\sec (a+b x)}}+\frac {\left (2 \sqrt {\cos (a+b x)} \sqrt {\sec (a+b x)}\right ) \int \sqrt {\cos (a+b x)} \, dx}{b} \\ & = -\frac {2 x}{b \sqrt {\sec (a+b x)}}+\frac {4 \sqrt {\cos (a+b x)} E\left (\left .\frac {1}{2} (a+b x)\right |2\right ) \sqrt {\sec (a+b x)}}{b^2} \\ \end{align*}

Mathematica [C] (verified)

Result contains higher order function than in optimal. Order 5 vs. order 4 in optimal.

Time = 0.64 (sec) , antiderivative size = 66, normalized size of antiderivative = 1.25 \[ \int x \sqrt {\sec (a+b x)} \sin (a+b x) \, dx=-\frac {2 \left (b x-2 \tan (a+b x)+\operatorname {Hypergeometric2F1}\left (\frac {1}{4},\frac {1}{2},\frac {3}{2},-\tan ^2(a+b x)\right ) \sqrt [4]{\sec ^2(a+b x)} \tan (a+b x)\right )}{b^2 \sqrt {\sec (a+b x)}} \]

[In]

Integrate[x*Sqrt[Sec[a + b*x]]*Sin[a + b*x],x]

[Out]

(-2*(b*x - 2*Tan[a + b*x] + Hypergeometric2F1[1/4, 1/2, 3/2, -Tan[a + b*x]^2]*(Sec[a + b*x]^2)^(1/4)*Tan[a + b
*x]))/(b^2*Sqrt[Sec[a + b*x]])

Maple [C] (verified)

Result contains complex when optimal does not.

Time = 0.30 (sec) , antiderivative size = 310, normalized size of antiderivative = 5.85

method result size
risch \(-\frac {\left (x b +2 i\right ) \left ({\mathrm e}^{2 i \left (x b +a \right )}+1\right ) \sqrt {2}\, \sqrt {\frac {{\mathrm e}^{i \left (x b +a \right )}}{{\mathrm e}^{2 i \left (x b +a \right )}+1}}\, {\mathrm e}^{-i \left (x b +a \right )}}{b^{2}}-\frac {2 i \left (-\frac {2 \left ({\mathrm e}^{2 i \left (x b +a \right )}+1\right )}{\sqrt {\left ({\mathrm e}^{2 i \left (x b +a \right )}+1\right ) {\mathrm e}^{i \left (x b +a \right )}}}+\frac {i \sqrt {-i \left (i+{\mathrm e}^{i \left (x b +a \right )}\right )}\, \sqrt {2}\, \sqrt {i \left ({\mathrm e}^{i \left (x b +a \right )}-i\right )}\, \sqrt {i {\mathrm e}^{i \left (x b +a \right )}}\, \left (-2 i \operatorname {EllipticE}\left (\sqrt {-i \left (i+{\mathrm e}^{i \left (x b +a \right )}\right )}, \frac {\sqrt {2}}{2}\right )+i \operatorname {EllipticF}\left (\sqrt {-i \left (i+{\mathrm e}^{i \left (x b +a \right )}\right )}, \frac {\sqrt {2}}{2}\right )\right )}{\sqrt {{\mathrm e}^{3 i \left (x b +a \right )}+{\mathrm e}^{i \left (x b +a \right )}}}\right ) \sqrt {2}\, \sqrt {\frac {{\mathrm e}^{i \left (x b +a \right )}}{{\mathrm e}^{2 i \left (x b +a \right )}+1}}\, \sqrt {\left ({\mathrm e}^{2 i \left (x b +a \right )}+1\right ) {\mathrm e}^{i \left (x b +a \right )}}\, {\mathrm e}^{-i \left (x b +a \right )}}{b^{2}}\) \(310\)

[In]

int(x*sin(b*x+a)*sec(b*x+a)^(1/2),x,method=_RETURNVERBOSE)

[Out]

-(x*b+2*I)*(exp(I*(b*x+a))^2+1)/b^2*2^(1/2)*(exp(I*(b*x+a))/(exp(I*(b*x+a))^2+1))^(1/2)/exp(I*(b*x+a))-2*I/b^2
*(-2*(exp(I*(b*x+a))^2+1)/((exp(I*(b*x+a))^2+1)*exp(I*(b*x+a)))^(1/2)+I*(-I*(I+exp(I*(b*x+a))))^(1/2)*2^(1/2)*
(I*(exp(I*(b*x+a))-I))^(1/2)*(I*exp(I*(b*x+a)))^(1/2)/(exp(I*(b*x+a))^3+exp(I*(b*x+a)))^(1/2)*(-2*I*EllipticE(
(-I*(I+exp(I*(b*x+a))))^(1/2),1/2*2^(1/2))+I*EllipticF((-I*(I+exp(I*(b*x+a))))^(1/2),1/2*2^(1/2))))*2^(1/2)*(e
xp(I*(b*x+a))/(exp(I*(b*x+a))^2+1))^(1/2)*((exp(I*(b*x+a))^2+1)*exp(I*(b*x+a)))^(1/2)/exp(I*(b*x+a))

Fricas [F(-2)]

Exception generated. \[ \int x \sqrt {\sec (a+b x)} \sin (a+b x) \, dx=\text {Exception raised: TypeError} \]

[In]

integrate(x*sin(b*x+a)*sec(b*x+a)^(1/2),x, algorithm="fricas")

[Out]

Exception raised: TypeError >>  Error detected within library code:   integrate: implementation incomplete (ha
s polynomial part)

Sympy [F]

\[ \int x \sqrt {\sec (a+b x)} \sin (a+b x) \, dx=\int x \sin {\left (a + b x \right )} \sqrt {\sec {\left (a + b x \right )}}\, dx \]

[In]

integrate(x*sin(b*x+a)*sec(b*x+a)**(1/2),x)

[Out]

Integral(x*sin(a + b*x)*sqrt(sec(a + b*x)), x)

Maxima [F]

\[ \int x \sqrt {\sec (a+b x)} \sin (a+b x) \, dx=\int { x \sqrt {\sec \left (b x + a\right )} \sin \left (b x + a\right ) \,d x } \]

[In]

integrate(x*sin(b*x+a)*sec(b*x+a)^(1/2),x, algorithm="maxima")

[Out]

integrate(x*sqrt(sec(b*x + a))*sin(b*x + a), x)

Giac [F]

\[ \int x \sqrt {\sec (a+b x)} \sin (a+b x) \, dx=\int { x \sqrt {\sec \left (b x + a\right )} \sin \left (b x + a\right ) \,d x } \]

[In]

integrate(x*sin(b*x+a)*sec(b*x+a)^(1/2),x, algorithm="giac")

[Out]

integrate(x*sqrt(sec(b*x + a))*sin(b*x + a), x)

Mupad [F(-1)]

Timed out. \[ \int x \sqrt {\sec (a+b x)} \sin (a+b x) \, dx=\int x\,\sin \left (a+b\,x\right )\,\sqrt {\frac {1}{\cos \left (a+b\,x\right )}} \,d x \]

[In]

int(x*sin(a + b*x)*(1/cos(a + b*x))^(1/2),x)

[Out]

int(x*sin(a + b*x)*(1/cos(a + b*x))^(1/2), x)